package fr.cnam.projetSiw.client.structure.pages;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

import fr.cnam.projetSiw.client.ressources.GeneralBundle;
import fr.cnam.projetSiw.client.structure.HomePlace;

public class MenuViewImpl extends Composite implements MenuView
{

	@UiField
	Label lblLogo;

	private static MenuViewImplUiBinder uiBinder = GWT.create(MenuViewImplUiBinder.class);

	interface MenuViewImplUiBinder extends UiBinder<Widget, MenuViewImpl>
	{
	}

	private Presenter presenter;

	public MenuViewImpl()
	{
		initWidget(uiBinder.createAndBindUi(this));

		lblLogo.addClickHandler(new ClickHandler()
		{

			@Override
			public void onClick(ClickEvent event)
			{
				presenter.goTo(new HomePlace("Accueil"));
			}
		});

		lblLogo.addStyleName(GeneralBundle.INSTANCE.css().pointer());
	}


	@Override
	public void setPresenter(ZicPresenter presenter)
	{
		this.presenter = (Presenter) presenter;
		
	}

}
